<nz-modal [(nzVisible)]="isVisible" [nzWidth]="modalWidth" (nzOnCancel)="onBack()" [nzStyle]="{'top': '50px'}">
  <div *nzModalTitle>{{ title }}</div>
  <ng-container *nzModalContent>
    <form [formGroup]="trainingRecordForm" (keydown.enter)="$event.preventDefault()">
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="candidateName" nzRequired>应聘者姓名</nz-form-label>
            <nz-form-control [nzErrorTip]="'请选择应聘者姓名'">
              <nz-input-group nzSearch [nzAddOnAfter]="candidateNameSuffixIconButton">
                <input nz-input formControlName="candidateName" placeholder="请选择应聘者姓名" readonly />
              </nz-input-group>
              <ng-template #candidateNameSuffixIconButton>
                <button nz-button nzType="primary" nzSearch (click)="findCandidate()"><nz-icon nzType="search" /></button>
              </ng-template>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="trainingName" nzRequired>培训名称</nz-form-label>
            <nz-form-control [nzErrorTip]="'请输入培训名称'">
              <input nz-input formControlName="trainingName" placeholder="请输入培训名称" maxlength="255"/>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="trainingDate">培训日期</nz-form-label>
            <nz-form-control >
              <nz-date-picker formControlName="trainingDate" nzFormat="yyyy-MM-dd"></nz-date-picker>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="durationHours" nzRequired>培训时长</nz-form-label>
            <nz-form-control [nzErrorTip]="'请输入培训时长'">
            <nz-input-number formControlName="durationHours" [nzMin]="1" [nzMax]="1" />
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="provider" nzRequired>培训供应商</nz-form-label>
            <nz-form-control [nzErrorTip]="'请输入培训供应商'">
              <input nz-input formControlName="provider" placeholder="请输入培训供应商" maxlength="255"/>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="22">
          <nz-form-item>
            <nz-form-label [nzSpan]="3" nzFor="trainingDescription">培训内容</nz-form-label>
            <nz-form-control [nzErrorTip]="'请选择培训内容'">
              <textarea nz-input formControlName="trainingDescription" placeholder="请输入培训内容" maxlength="65535"></textarea>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
    </form>
  </ng-container>
  <div *nzModalFooter>
    <div class="form-button-container">
      <button nz-button nzType="primary" (click)="onSave()" [nzLoading]="saveLoading">保存</button>
      <button nz-button nzType="default" (click)="onReset()" [nzLoading]="saveLoading">重置</button>
      <button nz-button nzType="default" (click)="onBack()">关闭</button>
    </div>
  </div>
</nz-modal>
<candidate-selector (candidateSelectedEvent)="handleCandidateSelectedEvent($event)"></candidate-selector>
